/**
 * @file   test_AdjMatrix.cpp
 * @author ywl <ywl@ywl-VirtualBox>
 * @date   Sat Dec  3 22:37:02 2022
 * 
 * @brief  Test class Adjacency_Matrix
 * 
 * 
 */

#include <iostream>
#include <vector>
#include "Adjiacency_Matrix.h"

int main()
{
    std::vector<char> name{'A','B','C','D','E','F'}; 

    /**
     * 有向有权图
     */
    std::cout << "-----------------Graph 1-------------------" << std::endl;
    // 构造图
    Adjiacency_Matrix<char> graph1(name,true,true,-1.0);
    graph1.add_edge('B','C',1.0);
    graph1.add_edge('B','F',2.0);
    graph1.add_edge('C','A',3.0);
    graph1.add_edge('C','C',4.0);
    graph1.add_edge('D','E',5.0);
    graph1.add_edge('E','D',6.0);
    graph1.add_edge('F','A',7.0);
    // 测试函数
    std::cout << "---------------------------" << std::endl;
    graph1.list_vertices();
    std::cout << "---------------------------" << std::endl;
    graph1.list_edges();
    std::cout << "---------------------------" << std::endl;
    graph1.print_graph();
    std::cout << "---------------------------" << std::endl;
    std::cout << "Number of vertices:\t" << graph1.num_vertices() << std::endl;
    std::cout << "---------------------------" << std::endl;
    std::cout << "Number of edges:\t" << graph1.num_edges() << std::endl;
    std::cout << "---------------------------" << std::endl;

    /**
     * 有向无权图
     */
    std::cout << "-----------------Graph 2-------------------" << std::endl;
    // 构造图
    Adjiacency_Matrix<char> graph2(name,true,false);
    graph2.add_edge('B','C');
    graph2.add_edge('B','F');
    graph2.add_edge('C','A');
    graph2.add_edge('C','C');
    graph2.add_edge('D','E');
    graph2.add_edge('E','D');
    graph2.add_edge('F','A');
    // 测试函数
    std::cout << "---------------------------" << std::endl;
    graph2.list_vertices();
    std::cout << "---------------------------" << std::endl;
    graph2.list_edges();
    std::cout << "---------------------------" << std::endl;
    graph2.print_graph();
    std::cout << "---------------------------" << std::endl;
    std::cout << "Number of vertices:\t" << graph2.num_vertices() << std::endl;
    std::cout << "---------------------------" << std::endl;
    std::cout << "Number of edges:\t" << graph2.num_edges() << std::endl;
    std::cout << "---------------------------" << std::endl;
    
    /**
     * 无向有权图
     */
    std::cout << "-----------------Graph 3-------------------" << std::endl;
    // 构造图
    Adjiacency_Matrix<char> graph3(name,false,true,-1.0);
    graph3.add_edge('B','C',1.0);
    graph3.add_edge('B','F',2.0);
    graph3.add_edge('C','A',3.0);
    graph3.add_edge('D','E',4.0);
    graph3.add_edge('F','A',5.0);
    // 测试函数
    std::cout << "---------------------------" << std::endl;
    graph3.list_vertices();
    std::cout << "---------------------------" << std::endl;
    graph3.list_edges();
    std::cout << "---------------------------" << std::endl;
    graph3.print_graph();
    std::cout << "---------------------------" << std::endl;
    std::cout << "Number of vertices:\t" << graph3.num_vertices() << std::endl;
    std::cout << "---------------------------" << std::endl;
    std::cout << "Number of edges:\t" << graph3.num_edges() << std::endl;
    std::cout << "---------------------------" << std::endl;

    /**
     * 无向无权图
     */
    std::cout << "-----------------Graph 4-------------------" << std::endl;
    // 构造图
    Adjiacency_Matrix<char> graph4(name,false,false);
    graph4.add_edge('B','C');
    graph4.add_edge('B','F');
    graph4.add_edge('C','A');
    graph4.add_edge('D','E');
    graph4.add_edge('F','A');
    // 测试函数
    std::cout << "---------------------------" << std::endl;
    graph4.list_vertices();
    std::cout << "---------------------------" << std::endl;
    graph4.list_edges();
    std::cout << "---------------------------" << std::endl;
    graph4.print_graph();
    std::cout << "---------------------------" << std::endl;
    std::cout << "Number of vertices:\t" << graph4.num_vertices() << std::endl;
    std::cout << "---------------------------" << std::endl;
    std::cout << "Number of edges:\t" << graph4.num_edges() << std::endl;
    std::cout << "---------------------------" << std::endl;
    
    return 0;
}
